<!DOCTYPE html >
<html>
<head>
    <link rel="stylesheet" href="demos.css" type="text/css" media="screen" />
    
    <script type="text/javascript" src="../libraries/RGraph.common.core.js" ></script>
    <script type="text/javascript" src="../libraries/RGraph.common.dynamic.js" ></script>
    <script type="text/javascript" src="../libraries/RGraph.common.tooltips.js" ></script>
    <script type="text/javascript" src="../libraries/RGraph.drawing.marker1.js" ></script>
    <script type="text/javascript" src="../libraries/RGraph.bar.js" ></script>
    <!--[if lt IE 9]><script src="../excanvas/excanvas.js"></script><![endif]-->
    
    <title>A Bar chart that also uses the drawing API</title>
</head>
<body>
        
    <h1>A Bar chart that also uses the drawing API</h1>
    
    <p>
        This Bar chart shows a regular bar chart that also makes use of the drawing API to draw a label on the chart.
    </p>

    <canvas id="cvs" width="600" height="250">[No canvas support]</canvas>

    <script>
        window.onload = function ()
        {
            var bar9 = new RGraph.Bar('cvs', [4,8,5,3,2])
            bar9.Set('chart.labels', ['Fred','John','James','Louis','Pete']);
            bar9.Draw();
            
            // Get the X/Y coordinates from the bar chart
            var idx = 2;
            var x   = bar9.coords[idx][0] + (bar9.coords[idx][2] / 2);
            var y   = bar9.coords[idx][1];
            var r   = 15;

            marker = new RGraph.Drawing.Marker1('cvs', x, y, r, 'A');
            marker.Set('chart.tooltips', ['John was the winner by a country mile.']);
            marker.Draw();
        }
    </script>


    <p>
        <a href="./">&laquo; Back</a>
    </p>

</body>
</html>